<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  <script src="Scripts/EventListener.js"></script>
</head>
<body>

<div id="mainElement">Main</div>
<div id="subscriber1">Subscriber 1</div>
<div id="subscriber2">Subscriber 2</div>

<script>
	/*var foodMenu = new Item({ 
		id: "element", 
		element: $('#element')
	});
	
	$("#element").click(foodMenu.CallEvent("click"));*/
	
	var main = new Event({
		//value: "Hi!"
	});
	
	var subscriber1 = function(sender)
						{
							console.log("Sender : " + sender);
						};
	var subscriber2 = function(sender)
						{
							$("#subscriber2").text(sender);
						};
	
	main.AddSubscriber(subscriber1);
	main.AddSubscriber(subscriber2);
	
	main.RemoveSubscriber(subscriber2);
	
	$("#mainElement").click(
	function()
	{
		main.Invoke("asd");
	});
	
</script>

</body>
</html>